Skip to content

创建会员卡二维码

商户创建会员卡后,可以调用此api创建二维码,用于投放会员卡,用户可扫码开通会员卡

请求参数类型描述
card_idstring会员卡id
jsonobject声明请求的JSON数据结构
activate_typestring会员卡激活类型
AUTO_ACTIVATE | JUMP_ACTIVATE 枚举值之一
activate_urlstring跳转激活的url
activate_appidstring跳转激活的appid
activate_pathstring跳转激活的path
outer_strstring自定义场景值
php
$instance->v3->marketing->membercardOpen->cards->_card_id_->qrcode->postAsync([
  'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
  'json' => [
    'activate_type' => 'AUTO_ACTIVATE',
    'activate_url' => 'https://w.url.cn/s/Ahz3p2C',
    'activate_appid' => 'wxea9c30a90fs8d3fe',
    'activate_path' => 'pages/activate/activate',
    'outer_str' => 'szwxtd',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/marketing/membercard-open/cards/{card_id}/qrcode')->postAsync([
  'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
  'json' => [
    'activate_type' => 'AUTO_ACTIVATE',
    'activate_url' => 'https://w.url.cn/s/Ahz3p2C',
    'activate_appid' => 'wxea9c30a90fs8d3fe',
    'activate_path' => 'pages/activate/activate',
    'outer_str' => 'szwxtd',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/marketing/membercard-open/cards/{card_id}/qrcode']->postAsync([
  'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
  'json' => [
    'activate_type' => 'AUTO_ACTIVATE',
    'activate_url' => 'https://w.url.cn/s/Ahz3p2C',
    'activate_appid' => 'wxea9c30a90fs8d3fe',
    'activate_path' => 'pages/activate/activate',
    'outer_str' => 'szwxtd',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->marketing->membercardOpen->cards->_card_id_->qrcode->post([
  'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
  'json' => [
    'activate_type' => 'AUTO_ACTIVATE',
    'activate_url' => 'https://w.url.cn/s/Ahz3p2C',
    'activate_appid' => 'wxea9c30a90fs8d3fe',
    'activate_path' => 'pages/activate/activate',
    'outer_str' => 'szwxtd',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/marketing/membercard-open/cards/{card_id}/qrcode')->post([
  'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
  'json' => [
    'activate_type' => 'AUTO_ACTIVATE',
    'activate_url' => 'https://w.url.cn/s/Ahz3p2C',
    'activate_appid' => 'wxea9c30a90fs8d3fe',
    'activate_path' => 'pages/activate/activate',
    'outer_str' => 'szwxtd',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/marketing/membercard-open/cards/{card_id}/qrcode']->post([
  'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
  'json' => [
    'activate_type' => 'AUTO_ACTIVATE',
    'activate_url' => 'https://w.url.cn/s/Ahz3p2C',
    'activate_appid' => 'wxea9c30a90fs8d3fe',
    'activate_path' => 'pages/activate/activate',
    'outer_str' => 'szwxtd',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
urlstring二维码对应的url

参阅 官方文档

Published on the GitHub by TheNorthMemory